<template>
  <div>
    <template v-for="(i, index) in curTableData.currencyPriceInfo">
      <div :key="index" class="medium-data-item">
        <span class="title">{{ i.label }}:</span>
        <template v-if="currencyPriceInfo[i.key]">
          <span v-if="i.role === 'priceFormat'" class="name keep-all">¥{{ currencyPriceInfo[i.key] | priceFormat(2, true) }}</span>
          <span v-else-if="(i.role === 'percent' && currencyPriceInfo[i.key])" class="name keep-all">{{ currencyPriceInfo[i.key]+'%' }}</span>
          <span v-else class="name keep-all">{{ currencyPriceInfo[i.key] }}</span>
        </template>
        <span v-else class="name keep-all">--</span>
      </div>
    </template>
  </div>
</template>
<script>
import { priceFormat } from '@/filters/number';
import { TableData } from '@/views/medium/mixin/mediumData';
export default {
  filters: { priceFormat },
  props: {
    activeTabs: {
      type: String,
      default: ''
    },
    currencyPriceInfo: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      TableData
    };
  },
  computed: {
    curTableData() {
      // 如果么有对应的 activeTabs 数据，则使用更多tab的数据 this.TableData['5']
      return this.TableData[this.activeTabs] || this.TableData['5'];
    }
  }
};
</script>
<style lang="scss" scoped>

</style>
